Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents

Managing Bounding Spheres

QuickDraw 3D provides routines that you can use to manage bounding spheres.

Q3BoundingSphere_Copy

You can use the Q3BoundingSphere_Copy function to make a copy of a bounding sphere.

TQ3BoundingSphere *Q3BoundingSphere_Copy (
                     const TQ3BoundingSphere *src,
                     TQ3BoundingSphere *dest);
src
A pointer to the bounding sphere to be copied.
dest
On entry, a pointer to a buffer large enough to hold a bounding sphere. On exit, a pointer to a copy of the bounding sphere specified by the src parameter.

DESCRIPTION

The Q3BoundingSphere_Copy function returns, as its function result and in the dest parameter, a copy of the bounding sphere specified by the src parameter. Q3BoundingSphere_Copy does not allocate any memory for the destination bounding sphere; the dest parameter must point to space allocated in the heap or on the stack before you call Q3BoundingSphere_Copy .

Q3BoundingSphere_Union

You can use the Q3BoundingSphere_Union function to find the union of two bounding spheres.

TQ3BoundingSphere *Q3BoundingSphere_Union (
                     const TQ3BoundingSphere *s1,
                     const TQ3BoundingSphere *s2,
                     TQ3BoundingSphere *result);
s1
A pointer to a bounding sphere.
s2
A pointer to a bounding sphere.
result
On exit, a pointer to the union of the bounding spheres s1 and s2 .

DESCRIPTION

The Q3BoundingSphere_Union function returns, as its function result and in the result parameter, a pointer to the bounding sphere that is the union of the two bounding spheres specified by the parameters s1 and s2 . The result parameter can point to the memory occupied by either s1 or s2 , thereby performing the union operation in place.

Q3BoundingSphere_Set

You can use the Q3BoundingSphere_Set function to set the defining origin and radius of a bounding sphere.

TQ3BoundingSphere *Q3BoundingSphere_Set (
                     TQ3BoundingSphere *bSphere,
                     const TQ3Point3D *origin,
                     float radius,
                     TQ3Boolean isEmpty);
bSphere
A pointer to a bounding sphere.
origin
A pointer to a three-dimensional point.
radius
A floating-point value that specifies the desired radius of the bounding sphere.
isEmpty
A Boolean value that indicates whether the specified bounding sphere is empty ( kQ3True ) or not ( kQ3False ).

DESCRIPTION

The Q3BoundingSphere_Set function assigns the values origin and radius to the origin and radius fields of the bounding sphere specified by the bSphere parameter. Q3BoundingSphere_Set also assigns the value of the isEmpty parameter to the isEmpty field of the bounding sphere.

Q3BoundingSphere_UnionPoint3D

You can use the Q3BoundingSphere_UnionPoint3D function to find the union of a bounding sphere and a three-dimensional point.

TQ3BoundingSphere *Q3BoundingSphere_UnionPoint3D (
                     const TQ3BoundingSphere *bSphere,
                     const TQ3Point3D *pt3D,
                     TQ3BoundingSphere *result);
bSphere
A pointer to a bounding sphere.
pt3D
A three-dimensional point.
result
On exit, a pointer to the union of the specified bounding sphere and the specified point.

DESCRIPTION

The Q3BoundingSphere_UnionPoint3D function returns, as its function result and in the result parameter, a pointer to the bounding sphere that is the union of the bounding sphere specified by the bSphere parameter and the three-dimensional point specified by the pt3D parameter. The result parameter can point to the memory pointed to by bSphere , thereby performing the union operation in place.

Q3BoundingSphere_UnionRationalPoint4D

You can use the Q3BoundingSphere_UnionRationalPoint4D function to find the union of a bounding sphere and a rational four-dimensional point.

TQ3BoundingSphere *Q3BoundingSphere_UnionRationalPoint4D (
                     const TQ3BoundingSphere *bSphere,
                     const TQ3RationalPoint4D *pt4D,
                     TQ3BoundingSphere *result);
bSphere
A pointer to a bounding sphere.
pt4D
A rational four-dimensional point.
result
On exit, a pointer to the union of the specified bounding sphere and the specified point.

DESCRIPTION

The Q3BoundingSphere_UnionRationalPoint4D function returns, as its function result and in the result parameter, a pointer to the bounding sphere that is the union of the bounding sphere specified by the bSphere parameter and the rational four-dimensional point specified by the pt4D parameter. The result parameter can point to the memory pointed to by bSphere , thereby performing the union operation in place.

Q3BoundingSphere_SetFromPoints3D

You can use the Q3BoundingSphere_SetFromPoints3D function to find the bounding sphere that bounds an arbitrary list of three-dimensional points.

TQ3BoundingSphere *Q3BoundingSphere_SetFromPoints3D (
                     TQ3BoundingSphere *bSphere,
                     const TQ3Point3D *pts,
                     unsigned long nPts,
                     unsigned long structSize);
bSphere
A pointer to a bounding sphere.
pts
A pointer to a list of three-dimensional points.
nPts
The number of points in the specified list.
structSize
The number of bytes of data that separate two successive points in the specified list of points.

DESCRIPTION

The Q3BoundingSphere_SetFromPoints3D function returns, as its function result and in the bSphere parameter, a pointer to a bounding sphere that contains all the points in the list of three-dimensional points specified by the pts parameter. The nPts parameter indicates how many points are in that list, and the structSize parameter indicates the offset between any two successive points in the list. By suitably specifying the value of the structSize parameter, you can have QuickDraw 3D extract points that are embedded in an array of larger data structures.

Q3BoundingSphere_SetFromRationalPoints4D

You can use the Q3BoundingSphere_SetFromRationalPoints4D function to find the bounding sphere that bounds an arbitrary list of rational four-dimensional points.

TQ3BoundingSphere *Q3BoundingSphere_SetFromRationalPoints4D (
                     TQ3BoundingSphere *bSphere,
                     const TQ3RationalPoint4D *pts,
                     unsigned long nPts,
                     unsigned long structSize);
bSphere
A pointer to a bounding sphere.
pts
A pointer to a list of rational four-dimensional points.
nPts
The number of points in the specified list.
structSize
The number of bytes of data that separate two successive points in the specified list of points.

DESCRIPTION

The Q3BoundingSphere_SetFromRationalPoints4D function returns, as its function result and in the bSphere parameter, a pointer to a bounding sphere that contains all the points in the list of rational four-dimensional points specified by the pts parameter. The nPts parameter indicates how many points are in that list, and the structSize parameter indicates the offset between any two successive points in the list. By suitably specifying the value of the structSize parameter, you can have QuickDraw 3D extract points that are embedded in an array of larger data structures.

 

 


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents